package no.gnet.edvd.web.types;

import java.io.Serializable;
import java.util.List;

import no.gnet.edvd.types.Player;
import no.gnet.edvd.types.Transfer;

import com.restfb.types.User;

/** immutable except authenticated */

public class EdvdSessionUser implements Serializable {

	private static final long serialVersionUID = -8682639124855882984L;

	public boolean authenticated = false;

	private User facebookUserdata;

	private Player player;
	
	List<Transfer> unpaidTransfers;

	public static EdvdSessionUser createSessionUser(User fbuserdata,
			Player player, List<Transfer> unpaidTransfers) {
		return createSessionUser(fbuserdata, player, false,unpaidTransfers);
	}

	public static EdvdSessionUser createSessionUser(User fbuserdata,
			Player player, boolean authenticated, List<Transfer> unpaidTransfers) {
		EdvdSessionUser edvduser = new EdvdSessionUser();
		edvduser.player = player;
		edvduser.facebookUserdata = fbuserdata;
		edvduser.authenticated = authenticated;
		edvduser.unpaidTransfers=unpaidTransfers;
		return edvduser;
	}

	public User getFacebookUserdata() {
		return facebookUserdata;
	}

	public Player getPlayer() {
		return player;
	}

	@Override
	public String toString() {
		return "EdvdSessionUser [authenticated=" + authenticated
				+ ", facebookUserdata=" + facebookUserdata + ", player="
				+ player + "]";
	}

	public List<Transfer> getUnpaidTransfers() {
		return unpaidTransfers;
	}

	public void setUnpaidTransfers(List<Transfer> unpaidTransfers) {
		this.unpaidTransfers = unpaidTransfers;
	}

}
